package com.example.zengxianghui900.netcomponent.api;

import com.example.netcomponent.net.BaseApi;
import com.example.netcomponent.net.CommonApiService;
import com.example.zengxianghui900.netcomponent.vo.VersionDataVo;
import com.trello.rxlifecycle.components.support.RxAppCompatActivity;

import retrofit2.Retrofit;
import rx.Observable;

/**
 * Created by ex-chenjunjie001 on 2017/10/13.
 * 检查新版本
 */

public class CheckVersionApi extends BaseApi<VersionDataVo> {
    private String appId;

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public CheckVersionApi(RxAppCompatActivity rxAppCompatActivity) {
        super(rxAppCompatActivity);
        setProgressMsg("正在获取最新版本...");
    }

    @Override
    public Observable getObservable(Retrofit retrofit) {
        ApiService apiService = retrofit.create(ApiService.class);
        return apiService.checkVersion(getAppId());
    }
}
